{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEX/AAAA/wAAAP8AAAD////b7vGPAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+AKDgoOCO0w/toAAAA0SURBVFjD7csxDQAwDAOwUCiFUhh/bkMQAJXs30kzTRRFURRFUZRzZZvXKIqiKIqiKOfKBxHG8hy74FXUAAAAAElFTkSuQmCC",
      "text/plain": [
       "2×2 Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}:\n",
       " RGB{N0f8}(1.0,0.0,0.0)  RGB{N0f8}(0.0,1.0,0.0)\n",
       " RGB{N0f8}(0.0,0.0,1.0)  RGB{N0f8}(0.0,0.0,0.0)"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "using Colors, Images\n",
    "img = [RGB(1,0,0) RGB(0,1,0);\n",
    "       RGB(0,0,1) RGB(0,0,0)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×2×2 Array{FixedPointNumbers.UFixed{UInt8,8},3}:\n",
       "[:, :, 1] =\n",
       " 1.0N0f8  0.0N0f8\n",
       " 0.0N0f8  0.0N0f8\n",
       " 0.0N0f8  1.0N0f8\n",
       "\n",
       "[:, :, 2] =\n",
       " 0.0N0f8  0.0N0f8\n",
       " 1.0N0f8  0.0N0f8\n",
       " 0.0N0f8  0.0N0f8"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "v = channelview(img)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×2×2 Array{UInt8,3}:\n",
       "[:, :, 1] =\n",
       " 0xff  0x00\n",
       " 0x00  0x00\n",
       " 0x00  0xff\n",
       "\n",
       "[:, :, 2] =\n",
       " 0x00  0x00\n",
       " 0xff  0x00\n",
       " 0x00  0x00"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r = rawview(v)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEX/AIAA/wAAAP8AAAD///97hNSYAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+AKDgoQBUfAvbgAAAA0SURBVFjD7csxDQAwDAOwUCiFUhh/bkMQAJXs30kzTRRFURRFUZRzZZvXKIqiKIqiKOfKBxHG8hy74FXUAAAAAElFTkSuQmCC",
      "text/plain": [
       "2×2 Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}:\n",
       " RGB{N0f8}(1.0,0.0,0.502)  RGB{N0f8}(0.0,1.0,0.0)\n",
       " RGB{N0f8}(0.0,0.0,1.0)    RGB{N0f8}(0.0,0.0,0.0)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r[3,1,1] = 128\n",
    "img"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Julia 0.5.1-pre",
   "language": "julia",
   "name": "julia-0.5"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "0.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
